package zhh.tangbao.system.aop;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import zhh.tangbao.system.annotation.NotRepeatSubmit;

/**
 * 2022/11/6
 * @author 粥灰灰
 * @version 1.0
 * 根据是否有@NotRepeatSubmit注解来禁止重复提交的请求接口，保证幂等性
 */

@Component
@Aspect
@Order(2)
public class NotRepeatSubmitAop {

    private static final Logger log = LoggerFactory.getLogger(NotRepeatSubmitAop.class);


    @Pointcut("@annotation(zhh.tangbao.system.annotation.NotRepeatSubmit)")
    public void notRepeatSubmit() {
    }

    @Before(value = "@annotation(notRepeatSubmit)")
    public void before(NotRepeatSubmit notRepeatSubmit) {

    }


}
